home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / Makefile.in < prev    next >
Makefile  |  1993-05-09  |  29KB  |  1,069 lines

  1. #
  2. # Makefile for directory with subdirs to build.
  3. #   Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
  4. #
  5. # This file is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16. #
  17.  
  18. srcdir = .
  19.  
  20. prefix = /usr/local
  21.  
  22. exec_prefix = $(prefix)
  23. bindir = $(exec_prefix)/bin
  24. libdir = $(exec_prefix)/lib
  25. tooldir = $(exec_prefix)/$(target)
  26.  
  27. program_transform_name =
  28.  
  29. datadir = $(prefix)/lib
  30. mandir = $(prefix)/man
  31. man1dir = $(mandir)/man1
  32. man2dir = $(mandir)/man2
  33. man3dir = $(mandir)/man3
  34. man4dir = $(mandir)/man4
  35. man5dir = $(mandir)/man5
  36. man6dir = $(mandir)/man6
  37. man7dir = $(mandir)/man7
  38. man8dir = $(mandir)/man8
  39. man9dir = $(mandir)/man9
  40. infodir = $(prefix)/info
  41. includedir = $(prefix)/include
  42. docdir = $(datadir)/doc
  43.  
  44. SHELL = /bin/sh
  45.  
  46. INSTALL = cp
  47. INSTALL_PROGRAM = $(INSTALL)
  48. INSTALL_DATA = $(INSTALL)
  49.  
  50. AS = as
  51. AR = ar
  52. AR_FLAGS = rc
  53. CC = cc
  54. CFLAGS = -g
  55. CXX = gcc
  56. CXXFLAGS = -g -O
  57. RANLIB = ranlib
  58. NM = nm
  59. GZIP = gzip
  60. COMPRESS = compress
  61.  
  62. # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
  63. BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
  64.         then echo $${rootme}/byacc/byacc ; \
  65.         else echo byacc ; \
  66.     fi`
  67.  
  68. LEX = `if [ -f $${rootme}/flex/flex ] ; \
  69.     then echo $${rootme}/flex/flex ; \
  70.     else echo flex ; fi`
  71.  
  72. MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
  73.     then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
  74.     else echo makeinfo ; fi`
  75.  
  76. EXPECT = `if [ -f $${rootme}/expect/expect ] ; \
  77.     then echo $${rootme}/expect/expect ; \
  78.     else echo expect ; fi`
  79.  
  80. RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
  81.     then echo $${srcroot}/dejagnu/runtest ; \
  82.     else echo runtest ; fi`
  83.  
  84.  
  85. # libraries that may need to be augmented on a system-by-system basis
  86. X11_LIB = -lX11
  87.  
  88. # compilers to use to create programs which must be run in the build
  89. # environment.
  90. CC_FOR_BUILD = $(CC)
  91. CXX_FOR_BUILD = $(CXX)
  92.  
  93. SUBDIRS = "this is set via configure, don't edit this"
  94. OTHERS = 
  95.  
  96. ALL = all.normal
  97. INSTALL_TARGET = install.all
  98.  
  99. CC_FOR_TARGET = ` \
  100.   if [ -f $${rootme}/gcc/Makefile ] ; then \
  101.     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
  102.   else \
  103.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  104.       echo $(CC); \
  105.     else \
  106.       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
  107.     fi; \
  108.   fi`
  109.  
  110.  
  111. CXX_FOR_TARGET = ` \
  112.   if [ -f $${rootme}/gcc/Makefile ] ; then \
  113.     echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
  114.   else \
  115.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  116.       echo $(CXX); \
  117.     else \
  118.       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
  119.     fi; \
  120.   fi`
  121.  
  122. AS_FOR_TARGET = ` \
  123.   if [ -f $${rootme}/gas/Makefile ] ; then \
  124.     echo $${rootme}/gas/as.new ; \
  125.   else \
  126.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  127.       echo $(AS); \
  128.     else \
  129.        t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
  130.     fi; \
  131.   fi`
  132.  
  133. AR_FOR_TARGET = ` \
  134.   if [ -f $${rootme}/binutils/Makefile ] ; then \
  135.     echo $${rootme}/binutils/ar ; \
  136.   else \
  137.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  138.       echo $(AR); \
  139.     else \
  140.        t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
  141.     fi; \
  142.   fi`
  143.  
  144. RANLIB_FOR_TARGET = ` \
  145.   if [ -f $${rootme}/binutils/Makefile ] ; then \
  146.     echo $${rootme}/binutils/ranlib ; \
  147.   else \
  148.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  149.       echo $(RANLIB); \
  150.     else \
  151.        t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
  152.     fi; \
  153.   fi`
  154.  
  155. NM_FOR_TARGET = ` \
  156.   if [ -f $${rootme}/binutils/Makefile ] ; then \
  157.     echo $${rootme}/binutils/nm ; \
  158.   else \
  159.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  160.       echo $(NM); \
  161.     else \
  162.        t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
  163.     fi; \
  164.   fi`
  165.  
  166. # FIXME: This is badly named.
  167. XTRAFLAGS = ` \
  168.   if [ -f $${rootme}/gcc/Makefile ] ; then \
  169.     if [ -f $${rootme}/newlib/Makefile ] ; then \
  170.       echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
  171.     else \
  172.       echo -I$${rootme}/gcc/include ; \
  173.     fi ; \
  174.   else \
  175.      echo ; \
  176.   fi`
  177.  
  178. PRMS = all-prms
  179.  
  180. #### host and target specific makefile fragments come in here.
  181. ###
  182.  
  183. # Flags to pass down to all sub-makes.
  184. # Please keep these in alphabetical order.
  185. BASE_FLAGS_TO_PASS = \
  186.     "AR_FLAGS=$(AR_FLAGS)" \
  187.     "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
  188.     "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
  189.     "BISON=$(BISON)" \
  190.     "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
  191.     "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
  192.     "CFLAGS=$(CFLAGS)" \
  193.     "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
  194.     "CXXFLAGS=$(CXXFLAGS)" \
  195.     "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
  196.     'GCC_FOR_TARGET=$$(CC_FOR_TARGET)' \
  197.     "INSTALL=$(INSTALL)" \
  198.     "INSTALL_DATA=$(INSTALL_DATA)" \
  199.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  200.     "LDFLAGS=$(LDFLAGS)" \
  201.     "LEX=$(LEX)" \
  202.     "LOADLIBES=$(LOADLIBES)" \
  203.     "MAKEINFO=$(MAKEINFO)" \
  204.     "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
  205.     "PRMS=$(PRMS)" \
  206.     "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
  207.     "EXPECT=$(EXPECT)" \
  208.     "RUNTEST=$(RUNTEST)" \
  209.     "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
  210.     "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
  211.     "exec_prefix=$(exec_prefix)" \
  212.     "prefix=$(prefix)" \
  213.     "tooldir=$(tooldir)" 
  214.  
  215. # Flags to pass down to most sub-makes, in which we're building with
  216. # the host environment.
  217. # If any variables are added here, they must be added to do-*, below.
  218. EXTRA_HOST_FLAGS = \
  219.     'AR=$(AR)' \
  220.     'AS=$(AS)' \
  221.     'CC=$(CC)' \
  222.     'CXX=$(CXX)' \
  223.     'NM=$(NM)' \
  224.     'RANLIB=$(RANLIB)' \
  225.     'XTRAFLAGS='
  226.  
  227. FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
  228.  
  229. # Flags that are concerned with the location of the X11 include files
  230. # and library files
  231. X11_FLAGS_TO_PASS = \
  232.     "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
  233.     "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
  234.     "X11_LIB=$(X11_LIB)"
  235.  
  236. # Flags to pass down to makes which are built with the target environment.
  237. # The double $ decreases the length of the command line; the variables
  238. # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
  239. # If any variables are added here, they must be added to do-*, below.
  240. EXTRA_TARGET_FLAGS = \
  241.     'AR=$$(AR_FOR_TARGET)' \
  242.     'AS=$$(AS_FOR_TARGET)' \
  243.     'CC=$$(CC_FOR_TARGET)' \
  244.     'CXX=$$(CXX_FOR_TARGET)' \
  245.     'NM=$$(NM_FOR_TARGET)' \
  246.     'RANLIB=$$(RANLIB_FOR_TARGET)' \
  247.     'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
  248.  
  249. TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
  250.  
  251. # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
  252. # unfortunately needs the native compiler and the target ar and
  253. # ranlib.
  254. # If any variables are added here, they must be added to do-*, below.
  255. EXTRA_GCC_FLAGS = \
  256.     'AR=$$(AR_FOR_TARGET)' \
  257.     'AS=$(AS)' \
  258.     'CC=$(CC)' \
  259.     'CXX=$(CXX)' \
  260.     'NM=$(NM)' \
  261.     'RANLIB=$$(RANLIB_FOR_TARGET)' \
  262.     'XTRAFLAGS='
  263.  
  264. GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
  265.  
  266. # This is a list of the targets for all of the modules which are compiled
  267. # using $(FLAGS_TO_PASS).
  268. ALL_MODULES = \
  269.     all-autoconf \
  270.     all-bfd \
  271.     all-binutils \
  272.     all-byacc \
  273.     all-cvs \
  274.     all-dejagnu \
  275.     all-diff \
  276.     all-etc \
  277.     all-fileutils \
  278.     all-find \
  279.     all-flex \
  280.     all-gas \
  281.     all-gawk \
  282.     all-gdb \
  283.     all-gprof \
  284.     all-grep \
  285.     all-gzip \
  286.     all-hello \
  287.     all-indent \
  288.     all-ispell \
  289.     all-ld \
  290.     all-libiberty \
  291.     all-m4 \
  292.     all-make \
  293.     all-mmalloc \
  294.     all-opcodes \
  295.     all-patch \
  296.     all-prms \
  297.     all-rcs \
  298.     all-readline \
  299.     all-recode \
  300.     all-sed \
  301.     all-send-pr \
  302.     all-shellutils \
  303.     all-sim \
  304.     all-tar \
  305.     all-tcl \
  306.     all-texinfo \
  307.     all-textutils \
  308.     all-tgas \
  309.     all-time \
  310.     all-uudecode \
  311.     all-wdiff
  312.  
  313. # This is a list of the check targets for all of the modules which are
  314. # compiled using $(FLAGS_TO_PASS).
  315. CHECK_MODULES = \
  316.     check-autoconf \
  317.     check-bfd \
  318.     check-binutils \
  319.     check-byacc \
  320.     check-cvs \
  321.     check-dejagnu \
  322.     check-diff \
  323.     check-etc \
  324.     check-fileutils \
  325.     check-find \
  326.     check-flex \
  327.     check-gas \
  328.     check-gawk \
  329.     check-gdb \
  330.     check-gprof \
  331.     check-grep \
  332.     check-gzip \
  333.     check-hello \
  334.     check-indent \
  335.     check-ispell \
  336.     check-ld \
  337.     check-libiberty \
  338.     check-m4 \
  339.     check-make \
  340.     check-mmcheckoc \
  341.     check-opcodes \
  342.     check-patch \
  343.     check-prms \
  344.     check-rcs \
  345.     check-readline \
  346.     check-recode \
  347.     check-sed \
  348.     check-send-pr \
  349.     check-shellutils \
  350.     check-sim \
  351.     check-tar \
  352.     check-tcl \
  353.     check-texinfo \
  354.     check-textutils \
  355.     check-tgas \
  356.     check-time \
  357.     check-uudecode \
  358.     check-wdiff
  359.  
  360. # This is a list of the install targets for all of the modules which are
  361. # compiled using $(FLAGS_TO_PASS).
  362. INSTALL_MODULES = \
  363.     install-autoconf \
  364.     install-bfd \
  365.     install-binutils \
  366.     install-byacc \
  367.     install-cvs \
  368.     install-dejagnu \
  369.     install-diff \
  370.     install-etc \
  371.     install-fileutils \
  372.     install-find \
  373.     install-flex \
  374.     install-gas \
  375.     install-gawk \
  376.     install-gdb \
  377.     install-glob \
  378.     install-gprof \
  379.     install-grep \
  380.     install-gzip \
  381.     install-hello \
  382.     install-indent \
  383.     install-ispell \
  384.     install-ld \
  385.     install-libiberty \
  386.     install-m4 \
  387.     install-make \
  388.     install-mmalloc \
  389.     install-opcodes \
  390.     install-patch \
  391.     install-prms \
  392.     install-rcs \
  393.     install-readline \
  394.     install-recode \
  395.     install-sed \
  396.     install-send-pr \
  397.     install-shellutils \
  398.     install-sim \
  399.     install-tar \
  400.     install-tcl \
  401.     install-texinfo \
  402.     install-textutils \
  403.     install-tgas \
  404.     install-time \
  405.     install-uudecode \
  406.     install-wdiff
  407.  
  408. # This is a list of the targets for all of the modules which are compiled
  409. # using $(X11_FLAGS_TO_PASS).
  410. ALL_X11_MODULES = \
  411.     all-emacs \
  412.     all-expect \
  413.     all-tclX \
  414.     all-tk
  415.  
  416. # This is a list of the check targets for all of the modules which are
  417. # compiled using $(X11_FLAGS_TO_PASS).
  418. CHECK_X11_MODULES = \
  419.     check-emacs \
  420.     check-expect \
  421.     check-tclX \
  422.     check-tk
  423.  
  424. # This is a list of the install targets for all the modules which are
  425. # compiled using $(X11_FLAGS_TO_PASS).
  426. INSTALL_X11_MODULES = \
  427.     install-emacs \
  428.     install-expect \
  429.     install-tclX \
  430.     install-tk
  431.  
  432. # This is a list of the targets for all of the modules which are compiled
  433. # using $(TARGET_FLAGS_TO_PASS).
  434. ALL_TARGET_MODULES = \
  435.     all-libg++ \
  436.     all-newlib \
  437.     all-xiberty
  438.  
  439. # This is a list of the check targets for all of the modules which are
  440. # compiled using $(TARGET_FLAGS_TO_PASS).
  441. CHECK_TARGET_MODULES = \
  442.     check-libg++ \
  443.     check-newlib \
  444.     check-xiberty
  445.  
  446. # This is a list of the install targets for all of the modules which are
  447. # compiled using $(TARGET_FLAGS_TO_PASS).
  448. INSTALL_TARGET_MODULES = \
  449.     install-libg++ \
  450.     install-newlib \
  451.     install-xiberty
  452.  
  453. # This is a shell case of all modules which are compiled using
  454. # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
  455. TARGET_LIBS = libg++ | newlib | xiberty
  456.  
  457. # The first rule in the file had better be this one.  Don't put any above it.
  458. all: $(ALL)
  459. .PHONY: all
  460.  
  461. # The target built for a native build.
  462. .PHONY: all.normal
  463. all.normal: \
  464.     $(ALL_MODULES) \
  465.     $(ALL_TARGET_MODULES) \
  466.     $(ALL_X11_MODULES) \
  467.     all-gcc
  468.  
  469. # The target built for a cross build.
  470. .PHONY: all.cross
  471. all.cross: \
  472.     all-bfd \
  473.     all-binutils \
  474.     all-byacc \
  475.     all-dejagnu \
  476.     all-flex \
  477.     all-gas \
  478.     all-gcc \
  479.     all-gdb \
  480.     all-ld \
  481.     all-libiberty \
  482.     all-mmalloc \
  483.     all-opcodes \
  484.     all-readline \
  485.     all-sim \
  486.     $(ALL_TARGET_MODULES)
  487.  
  488. # Do a target for all the subdirectories.  A ``make do-X'' will do a
  489. # ``make X'' in all subdirectories (because, in general, there is a
  490. # dependency (below) of X upon do-X, a ``make X'' will also do this,
  491. # but it may do additional work as well).
  492. # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
  493. # because it is so large that it can easily overflow the command line
  494. # length limit on some systems.
  495. DO_X = \
  496.     do-clean \
  497.     do-distclean \
  498.     do-dvi \
  499.     do-info \
  500.     do-install-info \
  501.     do-installcheck \
  502.     do-mostlyclean \
  503.     do-realclean
  504. .PHONY: $(DO_X)
  505. $(DO_X):
  506.     @target=`echo $@ | sed -e 's/^do-//'`; \
  507.     rootme=`pwd`; export rootme; \
  508.     srcroot=`cd $(srcdir); pwd`; export srcroot; \
  509.     for i in $(SUBDIRS); do \
  510.       if [ -f ./$$i/Makefile ]; then \
  511.         case $$i in \
  512.         $(TARGET_LIBS) ) \
  513.           for flag in $(EXTRA_TARGET_FLAGS); do \
  514.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  515.           done; \
  516.           ;; \
  517.         gcc) \
  518.           for flag in $(EXTRA_GCC_FLAGS); do \
  519.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  520.           done; \
  521.           ;; \
  522.         *) \
  523.           for flag in $(EXTRA_HOST_FLAGS); do \
  524.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  525.           done; \
  526.           ;; \
  527.         esac ; \
  528.         export AR AS CC CXX NM RANLIB XTRAFLAGS; \
  529.         if (cd ./$$i; \
  530.             $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  531.             "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
  532.             "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
  533.             $${target}); \
  534.         then true; else exit 1; fi; \
  535.       else true; fi; \
  536.     done
  537.  
  538. # Here are the targets which correspond to the do-X targets.
  539.  
  540. .PHONY: info installcheck dvi install-info
  541. .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
  542. info: do-info
  543. installcheck: do-installcheck
  544. dvi: do-dvi
  545.  
  546. install-info: install-info-dirs do-install-info dir.info
  547.     if [ -f dir.info ] ; then \
  548.       $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
  549.     else true ; fi
  550.  
  551. do-install-info: install-info-dirs
  552.  
  553. local-clean:
  554.     -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
  555.  
  556. local-distclean:
  557.     -rm -f Makefile config.status
  558.  
  559. clean: do-clean local-clean
  560. mostlyclean: do-mostlyclean local-clean
  561. distclean: do-distclean local-clean local-distclean
  562. realclean: do-realclean local-clean local-distclean
  563.  
  564. # Check target.
  565.  
  566. .PHONY: check
  567. check: $(CHECK_MODULES) \
  568.     $(CHECK_TARGET_MODULES) \
  569.     $(CHECK_X11_MODULES) \
  570.     check-gcc
  571.  
  572. # Installation targets.
  573.  
  574. .PHONY: install uninstall
  575. install: $(INSTALL_TARGET) 
  576.  
  577. uninstall:
  578.     @echo "the uninstall target is not supported in this tree"
  579.  
  580. .PHONY: install.all
  581. install.all: install-no-fixedincludes
  582.     @if [ -f ./gcc/Makefile ] ; then \
  583.         rootme=`pwd` ; export rootme ; \
  584.         (cd ./gcc; \
  585.         $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
  586.     else \
  587.         true ; \
  588.     fi
  589.  
  590. # install-no-fixedincludes is used because Cygnus can not distributed
  591. # the fixed header files.
  592. .PHONY: install-no-fixedincludes
  593. install-no-fixedincludes: \
  594.     install-dirs \
  595.     gcc-no-fixedincludes \
  596.     $(INSTALL_MODULES) \
  597.     $(INSTALL_TARGET_MODULES) \
  598.     $(INSTALL_X11_MODULES)
  599.  
  600. # Install the gcc headers files, but not the fixed include files,
  601. # which Cygnus is not allowed to distribute.  This rule is very
  602. # dependent on the workings of the gcc Makefile.in.
  603. .PHONY: gcc-no-fixedincludes
  604. gcc-no-fixedincludes:
  605.     @if [ -f ./gcc/Makefile ]; then \
  606.       rm -rf gcc/tmp-include; \
  607.       mv gcc/include gcc/tmp-include 2>/dev/null; \
  608.       mkdir gcc/include; \
  609.       touch gcc/stmp-fixincludes; \
  610.       rm -f gcc/stmp-headers; \
  611.       rootme=`pwd`; export rootme; \
  612.       srcroot=`cd $(srcdir); pwd` ; export srcroot; \
  613.       (cd ./gcc; \
  614.        $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  615.       rm -rf gcc/include; \
  616.       mv gcc/tmp-include gcc/include 2>/dev/null; \
  617.     else true; fi
  618.  
  619. .PHONY: install.cross
  620. install.cross: \
  621.     install-dirs \
  622.         install-binutils \
  623.     install-byacc \
  624.     install-dejagnu \
  625.     install-etc \
  626.     install-flex \
  627.     install-gas \
  628.     install-gcc \
  629.     install-gdb \
  630.         install-glob \
  631.         install-ld \
  632.     install-libiberty \
  633.     install-mmalloc \
  634.     install-opcodes \
  635.     install-readline \
  636.     $(INSTALL_TARGET_MODULES)
  637.  
  638. # This rule is used to build the modules which use FLAGS_TO_PASS.  To
  639. # build a target all-X means to cd to X and make all.
  640. # all-glob is handled specially because it doesn't actually build.
  641. .PHONY: $(ALL_MODULES) all-glob
  642. $(ALL_MODULES) all-glob:
  643.     @dir=`echo $@ | sed -e 's/all-//'`; \
  644.     if [ -f ./$${dir}/Makefile ] ; then \
  645.       rootme=`pwd`; export rootme; \
  646.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  647.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
  648.     else \
  649.       true; \
  650.     fi
  651.  
  652. # This rule is used to check the modules which use FLAGS_TO_PASS.  To
  653. # build a target check-X means to cd to X and make all.
  654. .PHONY: $(CHECK_MODULES) 
  655. $(CHECK_MODULES):
  656.     @dir=`echo $@ | sed -e 's/check-//'`; \
  657.     if [ -f ./$${dir}/Makefile ] ; then \
  658.       rootme=`pwd`; export rootme; \
  659.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  660.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
  661.     else \
  662.       true; \
  663.     fi
  664.  
  665. # This rule is used to install the modules which use FLAGS_TO_PASS.
  666. # To build a target install-X means to cd to X and make install.
  667. .PHONY: $(INSTALL_MODULES)
  668. $(INSTALL_MODULES): install-dirs
  669.     @dir=`echo $@ | sed -e 's/install-//'`; \
  670.     if [ -f ./$${dir}/Makefile ] ; then \
  671.       rootme=`pwd`; export rootme; \
  672.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  673.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
  674.     else \
  675.       true; \
  676.     fi
  677.  
  678. # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
  679. # To build a target all-X means to cd to X and make all.
  680. .PHONY: $(ALL_TARGET_MODULES)
  681. $(ALL_TARGET_MODULES):
  682.     @dir=`echo $@ | sed -e 's/all-//'`; \
  683.     if [ -f ./$${dir}/Makefile ] ; then \
  684.       rootme=`pwd`; export rootme; \
  685.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  686.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
  687.     else \
  688.       true; \
  689.     fi
  690.  
  691. # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
  692. # To build a target install-X means to cd to X and make install.
  693. .PHONY: $(CHECK_TARGET_MODULES)
  694. $(CHECK_TARGET_MODULES):
  695.     @dir=`echo $@ | sed -e 's/check-//'`; \
  696.     if [ -f ./$${dir}/Makefile ] ; then \
  697.       rootme=`pwd`; export rootme; \
  698.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  699.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
  700.     else \
  701.       true; \
  702.     fi
  703.  
  704. # This rule is used to install the modules which use
  705. # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
  706. # and make install.
  707. .PHONY: $(INSTALL_TARGET_MODULES)
  708. $(INSTALL_TARGET_MODULES): install-dirs
  709.     @dir=`echo $@ | sed -e 's/install-//'`; \
  710.     if [ -f ./$${dir}/Makefile ] ; then \
  711.       rootme=`pwd`; export rootme; \
  712.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  713.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
  714.     else \
  715.       true; \
  716.     fi
  717.  
  718. # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
  719. # To build a target all-X means to cd to X and make all.
  720. .PHONY: $(ALL_X11_MODULES)
  721. $(ALL_X11_MODULES):
  722.     @dir=`echo $@ | sed -e 's/all-//'`; \
  723.     if [ -f ./$${dir}/Makefile ] ; then \
  724.       rootme=`pwd`; export rootme; \
  725.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  726.       (cd $${dir}; \
  727.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
  728.     else \
  729.       true; \
  730.     fi
  731.  
  732. # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
  733. # To build a target check-X means to cd to X and make all.
  734. .PHONY: $(CHECK_X11_MODULES)
  735. $(CHECK_X11_MODULES):
  736.     @dir=`echo $@ | sed -e 's/check-//'`; \
  737.     if [ -f ./$${dir}/Makefile ] ; then \
  738.       rootme=`pwd`; export rootme; \
  739.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  740.       (cd $${dir}; \
  741.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
  742.     else \
  743.       true; \
  744.     fi
  745.  
  746. # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
  747. # To build a target install-X means to cd to X and make install.
  748. .PHONY: $(INSTALL_X11_MODULES)
  749. $(INSTALL_X11_MODULES):
  750.     @dir=`echo $@ | sed -e 's/install-//'`; \
  751.     if [ -f ./$${dir}/Makefile ] ; then \
  752.       rootme=`pwd`; export rootme; \
  753.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  754.       (cd $${dir}; \
  755.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
  756.     else \
  757.       true; \
  758.     fi
  759.  
  760. # gcc is the only module which uses GCC_FLAGS_TO_PASS.
  761. .PHONY: all-gcc
  762. all-gcc:
  763.     @if [ -f ./gcc/Makefile ] ; then \
  764.       rootme=`pwd`; export rootme; \
  765.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  766.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
  767.     else \
  768.       true; \
  769.     fi
  770.  
  771. .PHONY: check-gcc
  772. check-gcc:
  773.     @if [ -f ./gcc/Makefile ] ; then \
  774.       rootme=`pwd`; export rootme; \
  775.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  776.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
  777.     else \
  778.       true; \
  779.     fi
  780.  
  781. .PHONY: install-gcc
  782. install-gcc:
  783.     @if [ -f ./gcc/Makefile ] ; then \
  784.       rootme=`pwd`; export rootme; \
  785.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  786.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  787.     else \
  788.       true; \
  789.     fi
  790.  
  791. # This is a list of inter-dependencies among modules.
  792. all-autoconf:
  793. all-bfd:
  794. all-binutils: all-libiberty all-opcodes all-bfd all-flex
  795. all-byacc:
  796. all-cvs:
  797. all-dejagnu:
  798. all-diff: all-libiberty
  799. all-emacs:
  800. all-etc:
  801. all-expect: all-tcl
  802. all-fileutils:
  803. all-find:
  804. all-flex: all-libiberty all-byacc
  805. all-gas: all-libiberty all-opcodes all-bfd
  806. all-gawk:
  807. all-gcc: all-libiberty all-byacc all-binutils all-gas
  808. all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
  809. all-glob:
  810. all-gprof: all-libiberty all-bfd
  811. all-grep:
  812. all-gzip: all-libiberty
  813. all-hello: all-libiberty
  814. all-indent:
  815. all-ispell: all-emacs
  816. all-ld: all-libiberty all-bfd all-byacc all-flex
  817. all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
  818. all-libiberty:
  819. all-m4: all-libiberty
  820. all-make: all-libiberty
  821. all-mmalloc:
  822. all-newlib: all-binutils all-gas all-gcc
  823. all-opcodes:
  824. all-patch:
  825. all-prms:
  826. all-rcs:
  827. all-readline:
  828. all-recode: all-libiberty
  829. all-sed:
  830. all-send-pr:
  831. all-shellutils:
  832. all-sim: all-libiberty all-bfd
  833. all-tar: all-libiberty
  834. all-tcl:
  835. all-tclX: all-tcl all-tk
  836. all-tk: all-tcl
  837. all-texinfo: all-libiberty
  838. all-textutils:
  839. all-tgas: all-libiberty all-bfd
  840. all-time:
  841. all-wdiff:
  842. all-uudecode: all-libiberty
  843. all-xiberty: all-gcc all-newlib
  844.  
  845. ### other supporting targets
  846.  
  847. MAKEDIRS= \
  848.     $(prefix) \
  849.     $(exec_prefix) \
  850.     $(tooldir)
  851.  
  852. .PHONY: install-dirs
  853. install-dirs:
  854.     @for i in $(MAKEDIRS) ; do \
  855.         echo Making $$i... ; \
  856.         parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
  857.         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
  858.         if [ ! -d $$i ] ; then \
  859.             if mkdir $$i ; then \
  860.                 true ; \
  861.             else \
  862.                 exit 1 ; \
  863.             fi ; \
  864.         else \
  865.             true ; \
  866.         fi ; \
  867.     done
  868.  
  869. .PHONY: install-info-dirs 
  870. install-info-dirs:
  871.     if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
  872.     -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
  873.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  874.     -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
  875.  
  876. dir.info: do-install-info
  877.     if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
  878.       $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
  879.       mv -f dir.info.new dir.info ; \
  880.     else true ; \
  881.     fi
  882.  
  883. dist:
  884.     @echo "Building a full distribution of this tree isn't done"
  885.     @echo "via 'make dist'.  Check out the etc/ subdirectory" 
  886.  
  887. etags tags: TAGS
  888.  
  889. TAGS:
  890.     etags `$(MAKE) ls`
  891.  
  892. ls:
  893.     @echo Makefile
  894.     @for i in $(SUBDIRS); \
  895.     do \
  896.         (cd $$i; \
  897.             pwd=`pwd`; \
  898.             wd=`basename $$pwd`; \
  899.             for j in `$(MAKE) ls`; \
  900.             do \
  901.                 echo $$wd/$$j; \
  902.             done) \
  903.     done
  904.  
  905. # with the gnu make, this is done automatically.
  906.  
  907. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  908.     $(SHELL) ./config.status
  909.  
  910. #
  911. # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
  912.  
  913. DEVO_SUPPORT= README Makefile.in configure configure.in \
  914.     config.guess config.sub config move-if-change
  915. ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
  916.     configure.texi
  917. GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
  918. GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
  919.  
  920. .PHONY: setup-dirs-gdb gdb.tar.Z make-gdb.tar.Z
  921. setup-dirs-gdb:
  922.     ./configure sun4
  923.     $(MAKE) clean
  924.     ./configure -rm sun4
  925.     chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
  926.  
  927. gdb.tar.Z: setup-dirs-gdb
  928.     (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
  929.     (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
  930.     $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
  931.  
  932. make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
  933.     rm -rf proto-toplev; mkdir proto-toplev
  934.     ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
  935.     (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
  936.         ln -s ../$$i . ; \
  937.     done)
  938.     mkdir proto-toplev/etc
  939.     (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
  940.         ln -s ../../etc/$$i . ; \
  941.     done)
  942.     # Put only one copy (four hard links) of COPYING in the tar file.
  943.     rm                          proto-toplev/bfd/COPYING
  944.     ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
  945.     rm                          proto-toplev/include/COPYING
  946.     ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
  947.     rm                          proto-toplev/readline/COPYING
  948.     ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
  949.  
  950.     # Take out texinfo and glob from configurable dirs
  951.     rm proto-toplev/configure.in
  952.     sed -e '/^host_tools=/s/texinfo //' \
  953.         -e '/^host_libs=/s/glob //' \
  954.         <configure.in >proto-toplev/configure.in
  955.  
  956.     # Take out texinfo from a few places; make simple BISON=bison line.
  957.     rm proto-toplev/Makefile.in
  958.     sed -e '/^all\.normal: /s/\all-texinfo //' \
  959.         -e '/^    install-texinfo /d' \
  960.         -e '/^BISON = /,/^$$/d' \
  961.         -e '/^# BISON:/s/.*/BISON = bison -y/' \
  962.     <Makefile.in >proto-toplev/Makefile.in
  963.  
  964.     mkdir proto-toplev/texinfo
  965.     ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
  966.     ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
  967.     chmod og=u `find proto-toplev -print`
  968.     (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
  969.         ln -s proto-toplev gdb-$$VER; \
  970.         echo "==> Making gdb-$$VER.tar.Z"; \
  971.         tar cfh - gdb-$$VER | $(COMPRESS) -v >gdb-$$VER.tar.Z; \
  972.         echo "==> Making gdb-$$VER.tar.z"; \
  973.         tar cfh - gdb-$$VER | $(GZIP) -v -9 >gdb-$$VER.tar.z)
  974.  
  975.     # Make the testsuite archive separately.
  976.     ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
  977.     # Put a copy of COPYING in the tar file.
  978.     ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
  979.     chmod og=u `find proto-toplev/gdb/testsuite -print`
  980.     (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
  981.         echo "==> Making gdb-$$VER-testsuite.tar.Z"; \
  982.         tar cfh - gdb-$$VER/gdb/testsuite | \
  983.             $(COMPRESS) -v >gdb-$$VER-testsuite.tar.Z; \
  984.         echo "==> Making gdb-$$VER-testsuite.tar.z"; \
  985.         tar cfh - gdb-$$VER/gdb/testsuite | \
  986.             $(GZIP) -v -9 >gdb-$$VER-testsuite.tar.z)
  987.  
  988. # When you use `make setup-dirs' or `make taz' you should always redefine
  989. # this macro.
  990. SUPPORT_FILES = list-of-support-files-for-tool-in-question
  991. # Directories that might want `make proto-dir' run.
  992. PROTODIRS= gdb
  993.  
  994. .PHONY: setup-dirs taz
  995. setup-dirs:
  996.     ./configure sun4
  997.     $(MAKE) clean
  998.     ./configure -rm sun4
  999.     chmod og=u `find etc $(DEVO_SUPPORT) $(SUPPORT_FILES) -print`
  1000.     for d in .. $(PROTODIRS) ; do \
  1001.       if [ $$d != ".." ] && [ -d $$d ]; then \
  1002.         (cd $$d ; $(MAKE) -f Makefile.in proto-dir) ; \
  1003.       else true ; fi ; \
  1004.     done
  1005.  
  1006. taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
  1007.     rm -rf proto-toplev; mkdir proto-toplev
  1008.     for d in .. $(PROTODIRS) ; do \
  1009.       if [ $$d != .. ]; then \
  1010.         if [ -d $$d ]; then \
  1011.           ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
  1012.         else true ; fi ; \
  1013.       else true ; fi ; \
  1014.     done
  1015.     (cd proto-toplev; for i in $(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES); do \
  1016.         if [ ! -d $$i ]; then ln -s ../$$i . ; else true ; fi ; \
  1017.     done)
  1018.     mkdir proto-toplev/etc
  1019.     (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
  1020.         ln -s ../../etc/$$i . ; \
  1021.     done)
  1022.     # Put only one copy (four hard links) of COPYING in the tar file.
  1023.     ## FIX ME LATER
  1024.  
  1025.     # Take out texinfo and glob from configurable dirs
  1026.     rm proto-toplev/configure.in
  1027.     sed -e '/^host_tools=/s/texinfo //' \
  1028.         -e '/^host_libs=/s/glob //' \
  1029.         <configure.in >proto-toplev/configure.in
  1030.  
  1031.     # Take out texinfo from a few places; make simple BISON=bison line.
  1032.     rm proto-toplev/Makefile.in
  1033.     sed -e '/^all\.normal: /s/\all-texinfo //' \
  1034.         -e '/^    install-texinfo /d' \
  1035.         -e '/^BISON = /,/^$$/d' \
  1036.         -e '/^# BISON:/s/.*/BISON = bison -y/' \
  1037.     <Makefile.in >proto-toplev/Makefile.in
  1038.  
  1039.     mkdir proto-toplev/texinfo
  1040.     ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
  1041.     ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
  1042.     chmod og=u `find proto-toplev -print`
  1043.     (VER=`sed <$(TOOL)/Makefile.in -n 's/VERSION *= *//p'`; \
  1044.         echo "==> Making $(TOOL)-$$VER.tar.z"; \
  1045.         ln -s proto-toplev $(TOOL)-$$VER; \
  1046.         tar cfh - $(TOOL)-$$VER \
  1047.         | $(GZIP) -v >$(TOOL)-$$VER.tar.z)
  1048.  
  1049. GAS_SUPPORT_DIRS= bfd include libiberty opcodes
  1050.  
  1051. .PHONY: gas.tar.z
  1052. gas.tar.z: $(DEVO_SUPPORT) $(GAS_SUPPORT_DIRS) gas texinfo/texinfo.tex
  1053.     $(MAKE) -f Makefile.in setup-dirs SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
  1054.     $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas
  1055.  
  1056. .PHONY: gas+binutils.tar.z
  1057. GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld
  1058. gas+binutils.tar.z: $(DEVO_SUPPORT) $(GASB_SUPPORT_DIRS) gas texinfo/texinfo.tex
  1059.     $(MAKE) -f Makefile.in setup-dirs SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
  1060.     $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" TOOL=gas
  1061.  
  1062. .NOEXPORT:
  1063. MAKEOVERRIDES=
  1064.  
  1065.  
  1066. # end of Makefile.in
  1067.